package com.dituo.esac.enums;

public enum CheckStatusEnums {
	
	DO(1, "正常"),
	DO1(2, "异常")
	;
	
	private Integer code;
	private String desc;
	
	CheckStatusEnums(Integer eventType, String desc) {
		this.setCode(eventType);
		this.setDesc(desc);
	}

	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	/**
	 * 通过Code获得Desc
	 * @param code
	 * @return
	 */
	public static String getDescByCode(Integer code) {
		if (null == code) {
			return null;
		}
		for (CheckStatusEnums enums : CheckStatusEnums.values()) {
			if (enums.getCode().equals(code)) {
				return enums.getDesc();
			}
		}
		return null;
	}
}
